<template>
  <curd-page
    :action="action"
    :searchComponents="searchComponents"
    :columns="columns"
    title="添加管理员"
    @ok="handleOk"
  >
    <a-form slot="dialog-form">
      <a-form-item label="用户名" :labelCol="colConfig.labelCol" :wrapperCol="colConfig.wrapperCol">
        <a-input placeholder="请输入用户名"></a-input>
      </a-form-item>
      <a-form-item label="手机号" :labelCol="colConfig.labelCol" :wrapperCol="colConfig.wrapperCol">
        <a-input placeholder="请输入手机号"></a-input>
      </a-form-item>
    </a-form>
  </curd-page>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      confirmLoading: false,
      searchComponents: [
        { label: "用户名", code: "username" },
        { label: "手机号", code: "phone" }
      ],
      columns: [
        { title: "编号", dataIndex: "id", width: 80 },
        { title: "用户名", dataIndex: "username", width: 120 },
        { title: "手机号", dataIndex: "phone", width: 150 },
        { title: "备注", dataIndex: "remark" }
      ],
      action: {
        query: "admin/page",
        delete: "admin/delete",
        save: "admin/save"
      },
      colConfig: {
        labelCol: {
          span: 5
        },
        wrapperCol: {
          span: 16
        }
      }
    };
  },
  methods: {
    handleOk() {
      alert(1);
    }
  }
};
</script>

<style>
</style>
